package org.zerg.controller.api;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zerg.entity.Category;
import org.zerg.service.CategoryService;

@Controller
@RequestMapping("/api")
public class CategoryController {

	@Autowired
	private CategoryService categoryService;
	
	@ResponseBody
	@RequestMapping(value="/category/all", method = RequestMethod.GET,
            produces = {"application/json;charset=UTF-8"})
	public List<Category> CategoryAll(){
		List<Category> list = categoryService.categoryAll();
		return list;
	}
}
